home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / ACORNUSERS / CBSA / EDUCATION / WIMPPOLL / cc / WimpError < prev    next >
Text File  |  1997-12-13  |  850b  |  53 lines

  1.  
  2. //-----------------------------------
  3. //            WimpError.c
  4. //-----------------------------------
  5.  
  6. // GCC does'nt support C++ exception (throw, catch and try)
  7.  
  8. #include "os.h"
  9. #include "trap.h"
  10.  
  11. void throw(os_error *e)
  12. {
  13.   int r[10];
  14.   r[0] = int(e);
  15.   r[1] = 0;
  16.   r[2] = int("OS Error");
  17.  (void) os_swi(Wimp_ReportError,r);
  18. }
  19.  
  20. void throw(char *s)
  21. {
  22.   os_error err;
  23.   int r[10];
  24.   err.err = 0;
  25.   strcpy(err.mess,s);
  26.   r[0] = int(&err);
  27.   r[1] = 0;
  28.   r[2] = int("Wimp Error");
  29.  (void) os_swi(Wimp_ReportError, r);
  30. }
  31.  
  32. void Open_WindowCommand(char *title)
  33. {
  34.   int r[10];
  35.   r[0] = (int) title;
  36.   os_swi(Wimp_CommandWindow,r);
  37. }
  38.  
  39. void Open_WindowCommand()
  40. {
  41.   int r[10];
  42.   r[0] = 1;
  43.   os_swi(Wimp_CommandWindow,r);
  44. }
  45.  
  46. void Close_WindowCommand(int immediat)
  47. {
  48.   int r[10];
  49.   r[0] = 0;
  50.   if (immediat != 0) r[0] = -1;
  51.   os_swi(Wimp_CommandWindow,r);
  52. }
  53.